<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: Math C API</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Math C API<div class="ingroups"><a class="el" href="group__contractdev.html">Smart Contract API Reference</a> &raquo; <a class="el" href="group__mathapi.html">Math API</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Defines basic mathematical operations for higher abstractions to use.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga61d571f58c24fb4663cc3729f3d5613e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#ga61d571f58c24fb4663cc3729f3d5613e">multeq_i128</a> (<a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *self, const <a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *other)</td></tr>
<tr class="memdesc:ga61d571f58c24fb4663cc3729f3d5613e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two 128 unsigned bit integers. Throws exception if pointers are invalid.  <a href="#ga61d571f58c24fb4663cc3729f3d5613e">More...</a><br /></td></tr>
<tr class="separator:ga61d571f58c24fb4663cc3729f3d5613e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad70a23703654281749410aef05c85c74"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#gad70a23703654281749410aef05c85c74">diveq_i128</a> (<a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *self, const <a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *other)</td></tr>
<tr class="memdesc:gad70a23703654281749410aef05c85c74"><td class="mdescLeft">&#160;</td><td class="mdescRight">Divide two 128 unsigned bit integers and throws an exception in case of invalid pointers.  <a href="#gad70a23703654281749410aef05c85c74">More...</a><br /></td></tr>
<tr class="separator:gad70a23703654281749410aef05c85c74"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7372b74e4cb87455342d39bdf3724811"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#ga7372b74e4cb87455342d39bdf3724811">double_add</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b)</td></tr>
<tr class="memdesc:ga7372b74e4cb87455342d39bdf3724811"><td class="mdescLeft">&#160;</td><td class="mdescRight">Addition between two double.  <a href="#ga7372b74e4cb87455342d39bdf3724811">More...</a><br /></td></tr>
<tr class="separator:ga7372b74e4cb87455342d39bdf3724811"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6390d36d23bd89bcd9bcf52385ba88f2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#ga6390d36d23bd89bcd9bcf52385ba88f2">double_mult</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b)</td></tr>
<tr class="memdesc:ga6390d36d23bd89bcd9bcf52385ba88f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiplication between two double.  <a href="#ga6390d36d23bd89bcd9bcf52385ba88f2">More...</a><br /></td></tr>
<tr class="separator:ga6390d36d23bd89bcd9bcf52385ba88f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad67af06a6b0e9dbbf3be05d6bf99257c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b)</td></tr>
<tr class="memdesc:gad67af06a6b0e9dbbf3be05d6bf99257c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Division between two double.  <a href="#gad67af06a6b0e9dbbf3be05d6bf99257c">More...</a><br /></td></tr>
<tr class="separator:gad67af06a6b0e9dbbf3be05d6bf99257c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga68d359e670da751723bf3d78ff759614"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#ga68d359e670da751723bf3d78ff759614">double_lt</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b)</td></tr>
<tr class="memdesc:ga68d359e670da751723bf3d78ff759614"><td class="mdescLeft">&#160;</td><td class="mdescRight">Less than comparison between two double.  <a href="#ga68d359e670da751723bf3d78ff759614">More...</a><br /></td></tr>
<tr class="separator:ga68d359e670da751723bf3d78ff759614"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8911bd5a24e0d8287d6b3d5a81500e6a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#ga8911bd5a24e0d8287d6b3d5a81500e6a">double_eq</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b)</td></tr>
<tr class="memdesc:ga8911bd5a24e0d8287d6b3d5a81500e6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equality check between two double.  <a href="#ga8911bd5a24e0d8287d6b3d5a81500e6a">More...</a><br /></td></tr>
<tr class="separator:ga8911bd5a24e0d8287d6b3d5a81500e6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab60e3f0c6651ad497f6665e032e39f6a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#gab60e3f0c6651ad497f6665e032e39f6a">double_gt</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a, <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b)</td></tr>
<tr class="memdesc:gab60e3f0c6651ad497f6665e032e39f6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Greater than comparison between two double.  <a href="#gab60e3f0c6651ad497f6665e032e39f6a">More...</a><br /></td></tr>
<tr class="separator:gab60e3f0c6651ad497f6665e032e39f6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1388e46084036133e57508c18590b1ed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#ga1388e46084036133e57508c18590b1ed">double_to_i64</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a)</td></tr>
<tr class="memdesc:ga1388e46084036133e57508c18590b1ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert double to 64 bit unsigned integer.  <a href="#ga1388e46084036133e57508c18590b1ed">More...</a><br /></td></tr>
<tr class="separator:ga1388e46084036133e57508c18590b1ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaec506d4ee77526e67ab5f2a8ef54f2b5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a> (<a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a)</td></tr>
<tr class="memdesc:gaec506d4ee77526e67ab5f2a8ef54f2b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert 64 bit unsigned integer to double (interpreted as 64 bit unsigned integer)  <a href="#gaec506d4ee77526e67ab5f2a8ef54f2b5">More...</a><br /></td></tr>
<tr class="separator:gaec506d4ee77526e67ab5f2a8ef54f2b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="gad70a23703654281749410aef05c85c74"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad70a23703654281749410aef05c85c74">&#9670;&nbsp;</a></span>diveq_i128()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void diveq_i128 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *&#160;</td>
          <td class="paramname"><em>other</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Divide two 128 bit unsigned integers and assign the value to the first parameter. It will throw an exception if the value of other is zero. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>Pointer to numerator. It will be replaced with the result </td></tr>
    <tr><td class="paramname">other</td><td>Pointer to denominator Example: <div class="fragment"><div class="line"><a class="code" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> <span class="keyword">self</span>(100);</div><div class="line"><a class="code" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> other(100);</div><div class="line"><a class="code" href="group__mathcapi.html#gad70a23703654281749410aef05c85c74">diveq_i128</a>(&amp;<span class="keyword">self</span>, &amp;other);</div><div class="line"><a class="code" href="group__consolecapi.html#ga0ac41ae1c31cf87a4adc14d9edb3e6a5">printi128</a>(<span class="keyword">self</span>); <span class="comment">// Output: 1</span></div></div><!-- fragment --> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga7372b74e4cb87455342d39bdf3724811"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7372b74e4cb87455342d39bdf3724811">&#9670;&nbsp;</a></span>double_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> double_add </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the result of addition between two double interpreted as 64 bit unsigned integer This function will first reinterpret_cast both inputs to double (50 decimal digit precision), add them together, and reinterpret_cast the result back to 64 bit unsigned integer. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
    <tr><td class="paramname">b</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of addition reinterpret_cast to 64 bit unsigned integers</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(2) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#ga7372b74e4cb87455342d39bdf3724811">double_add</a>( a, b );</div><div class="line"><a class="code" href="group__consolecapi.html#gae533b1ec1f098222339ad296a7d882c8">printd</a>(res); <span class="comment">// Output: 3</span></div></div><!-- fragment --> 
</div>
</div>
<a id="gad67af06a6b0e9dbbf3be05d6bf99257c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad67af06a6b0e9dbbf3be05d6bf99257c">&#9670;&nbsp;</a></span>double_div()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> double_div </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the result of division between two double interpreted as 64 bit unsigned integer This function will first reinterpret_cast both inputs to double (50 decimal digit precision), divide numerator with denominator, and reinterpret_cast the result back to 64 bit unsigned integer. Throws an error if b is zero (after it is reinterpret_cast to double) </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Numerator in double interpreted as 64 bit unsigned integer </td></tr>
    <tr><td class="paramname">b</td><td>Denominator in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of division reinterpret_cast to 64 bit unsigned integers</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(100) );</div><div class="line"><a class="code" href="group__consolecapi.html#gae533b1ec1f098222339ad296a7d882c8">printd</a>(a); <span class="comment">// Output: 0.1</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ga8911bd5a24e0d8287d6b3d5a81500e6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8911bd5a24e0d8287d6b3d5a81500e6a">&#9670;&nbsp;</a></span>double_eq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> double_eq </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the result of equality check between two double This function will first reinterpret_cast both inputs to double (50 decimal digit precision) before doing equality check. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
    <tr><td class="paramname">b</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if first input is equal to second input, 0 otherwise</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(2) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#ga8911bd5a24e0d8287d6b3d5a81500e6a">double_eq</a>( a, b );</div><div class="line"><a class="code" href="group__consolecapi.html#ga23902e1572b43c290fed01d9ae736a78">printi</a>(res); <span class="comment">// Output: 0</span></div></div><!-- fragment --> 
</div>
</div>
<a id="gab60e3f0c6651ad497f6665e032e39f6a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab60e3f0c6651ad497f6665e032e39f6a">&#9670;&nbsp;</a></span>double_gt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> double_gt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the result of greater than comparison between two double This function will first reinterpret_cast both inputs to double (50 decimal digit precision) before doing the greater than comparison. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
    <tr><td class="paramname">b</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if first input is greater than second input, 0 otherwise</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(2) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#gab60e3f0c6651ad497f6665e032e39f6a">double_gt</a>( a, b );</div><div class="line"><a class="code" href="group__consolecapi.html#ga23902e1572b43c290fed01d9ae736a78">printi</a>(res); <span class="comment">// Output: 0</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ga68d359e670da751723bf3d78ff759614"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga68d359e670da751723bf3d78ff759614">&#9670;&nbsp;</a></span>double_lt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> double_lt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the result of less than comparison between two double This function will first reinterpret_cast both inputs to double (50 decimal digit precision) before doing the less than comparison. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
    <tr><td class="paramname">b</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if first input is smaller than second input, 0 otherwise</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(2) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#ga68d359e670da751723bf3d78ff759614">double_lt</a>( a, b );</div><div class="line"><a class="code" href="group__consolecapi.html#ga23902e1572b43c290fed01d9ae736a78">printi</a>(res); <span class="comment">// Output: 1</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ga6390d36d23bd89bcd9bcf52385ba88f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6390d36d23bd89bcd9bcf52385ba88f2">&#9670;&nbsp;</a></span>double_mult()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> double_mult </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Get the result of multiplication between two double interpreted as 64 bit unsigned integer This function will first reinterpret_cast both inputs to double (50 decimal digit precision), multiply them together, and reinterpret_cast the result back to 64 bit unsigned integer. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
    <tr><td class="paramname">b</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of multiplication reinterpret_cast to 64 bit unsigned integers</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(10) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> b = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(2) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#ga6390d36d23bd89bcd9bcf52385ba88f2">double_mult</a>( a, b );</div><div class="line"><a class="code" href="group__consolecapi.html#gae533b1ec1f098222339ad296a7d882c8">printd</a>(res); <span class="comment">// Output: 2.5</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ga1388e46084036133e57508c18590b1ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1388e46084036133e57508c18590b1ed">&#9670;&nbsp;</a></span>double_to_i64()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> double_to_i64 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Convert double (interpreted as 64 bit unsigned integer) to 64 bit unsigned integer. This function will first reinterpret_cast the input to double (50 decimal digit precision) then convert it to double, then reinterpret_cast it to 64 bit unsigned integer. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>Value in double interpreted as 64 bit unsigned integer </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of conversion in 64 bit unsigned integer</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> a = <a class="code" href="group__mathcapi.html#gad67af06a6b0e9dbbf3be05d6bf99257c">double_div</a>( <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(5), <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>(2) );</div><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#ga1388e46084036133e57508c18590b1ed">double_to_i64</a>( a );</div><div class="line"><a class="code" href="group__consolecapi.html#ga23902e1572b43c290fed01d9ae736a78">printi</a>(res); <span class="comment">// Output: 2</span></div></div><!-- fragment --> 
</div>
</div>
<a id="gaec506d4ee77526e67ab5f2a8ef54f2b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaec506d4ee77526e67ab5f2a8ef54f2b5">&#9670;&nbsp;</a></span>i64_to_double()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> i64_to_double </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td>
          <td class="paramname"><em>a</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Convert 64 bit unsigned integer to double (interpreted as 64 bit unsigned integer). This function will convert the input to double (50 decimal digit precision) then reinterpret_cast it to 64 bit unsigned integer. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>Value to be converted </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of conversion in double (interpreted as 64 bit unsigned integer)</dd></dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> res = <a class="code" href="group__mathcapi.html#gaec506d4ee77526e67ab5f2a8ef54f2b5">i64_to_double</a>( 3 );</div><div class="line"><a class="code" href="group__consolecapi.html#gae533b1ec1f098222339ad296a7d882c8">printd</a>(res); <span class="comment">// Output: 3</span></div></div><!-- fragment --> 
</div>
</div>
<a id="ga61d571f58c24fb4663cc3729f3d5613e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga61d571f58c24fb4663cc3729f3d5613e">&#9670;&nbsp;</a></span>multeq_i128()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void multeq_i128 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> *&#160;</td>
          <td class="paramname"><em>other</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Multiply two 128 bit unsigned integers and assign the value to the first parameter. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>Pointer to the value to be multiplied. It will be replaced with the result. </td></tr>
    <tr><td class="paramname">other</td><td>Pointer to the Value to be multiplied.</td></tr>
  </table>
  </dd>
</dl>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> <span class="keyword">self</span>(100);</div><div class="line"><a class="code" href="group__types.html#ga396787e5ec029b1205bd3e4cd9763e7d">uint128_t</a> other(100);</div><div class="line"><a class="code" href="group__mathcapi.html#ga61d571f58c24fb4663cc3729f3d5613e">multeq_i128</a>(&amp;<span class="keyword">self</span>, &amp;other);</div><div class="line"><a class="code" href="group__consolecapi.html#ga0ac41ae1c31cf87a4adc14d9edb3e6a5">printi128</a>(<span class="keyword">self</span>); <span class="comment">// Output: 10000</span></div></div><!-- fragment --> 
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
